﻿using BLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace L20241017.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AdminController : ControllerBase
    {
        public AdminController(AdminBll bll)
        {
            Bll = bll;
        }

        public AdminBll Bll { get; }

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        /// 
        [HttpGet]
        public IActionResult Login(string name, string pwd)
        {
            try
            {
                var res = Bll.Login(name, pwd);
                return Ok(new
                {
                    data = res
                });



            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
